/*
* ------------------------------------------------------------------
* Copyright © 2017 Hangzhou DtDream Technology Co.,Lt d. All rights reserved.
* ------------------------------------------------------------------
*       Product: 
*   Module Name: 
*  Date Created: 2017-11-30
*   Description:
* ------------------------------------------------------------------
* Modification History
* DATE            Name           Description
* ------------------------------------------------------------------
* 2017-11-30     lihongbin wx-5363     ::tada
* ------------------------------------------------------------------
*/
package com.example.demo.controller;

import com.example.demo.utils.gis.LngAndLatUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * Created by qwesdfok on 2017/11/30.
 */
@Controller
public class GisController {
    @RequestMapping("gis")
    public String Gis(String address,ModelMap model){
        System.out.println(address);
        Map<String,Double> map= LngAndLatUtil.getLngAndLat(address);
        if(address==null){
            address="北京";
        }
        System.out.println("经度："+map.get("lng")+"---纬度："+map.get("lat"));
        model.addAttribute("mapX", map.get("lng"));
        model.addAttribute("mapY", map.get("lat"));
        return "map";
    }
}
